<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Javascript：使用JS特性判断浏览器的类型和版本</title>
</head>

<body>
<p style="color: #69F; text-align: center; font-size: 18px; font-weight: bold;">swfobject从1.5升级到2.2指南</p>
<p>参考网址：<br />
<a href="http://ajax.googleapis.com/ajax/libs/swfobject/2/swfobject.js">http://ajax.googleapis.com/ajax/libs/swfobject/2/swfobject.js</a>：Google CDN上的swfobject2.2。现在已经很难找到swfobject1.5版本的JS了。</p>
<p><strong>1、swfobject1.5使用示例：</strong></p>
<p>&lt;script type=&quot;text/javascript&quot;&gt;<br />
var swfPath = &quot;myswf01.swf&quot;;<br />
var so15 = new SWFObject(swfPath, &quot;mymovie&quot;, &quot;600&quot;, &quot;480&quot;, &quot;9&quot;, &quot;#000000&quot;);<br />
<br />
so15.addVariable(&quot;playmode&quot;, &quot;bigplayer&quot;);<br />
so15.addVariable(&quot;forceFLV&quot;, &quot;abc/a.flv&quot;);<br />
so15.addVariable(&quot;autoplay&quot;, &quot;no&quot;);<br />
so15.addVariable(&quot;skipAdsense&quot;, &quot;yes&quot;);<br />
so15.addVariable(&quot;onlyReplay&quot;, &quot;yes&quot;);<br />
<br />
so15.addParam(&quot;allowFullScreen&quot;, &quot;true&quot;);<br />
so15.addParam(&quot;allowScriptAccess&quot;, &quot;sameDomain&quot;);<br />
<br />
so15.write(&quot;mydiv01&quot;); //mydiv01为DIV的id<br />
&lt;/script&gt;</p>
<p>&nbsp;</p>
<p>2、<strong>相对应的swfobject2.2使用示例，即升级为swfobject2.2后，代表将变成如下：</strong></p>
<p>&lt;script type=&quot;text/javascript&quot;&gt;<br />
  </p>
<p>var swfPath = &quot;myswf01.swf&quot;;<br />
  <br />
  //1、使用字面量Json方式初始化变量、参数、属性<br />
  var flashvars = {<br />
  forceFLV: &quot;abc/a.flv&quot;,<br />
  playmode: &quot;bigplayer&quot;,<br />
  autoplay: &quot;no&quot;,<br />
  skipAdsense: &quot;yes&quot;,<br />
  onlyReplay: &quot;yes&quot;<br />
  };<br />
  var params = {<br />
  bgcolor: &quot;#000000&quot;,<br />
  allowFullScreen: &quot;true&quot;,<br />
  allowScriptAccess: &quot;sameDomain&quot;<br />
  };<br />
  var attributes = {<br />
  id: &quot;mymovie&quot;,<br />
  name: &quot;mymovie&quot;<br />
  };<br />
  <br />
  swfobject.embedSWF(swfPath, &quot;mydiv01&quot;, &quot;600&quot;, &quot;480&quot;, &quot;9&quot;, &quot;expressInstall.swf&quot;, flashvars, params, attributes);<br />
  <br />
&lt;/script&gt;</p>
<p>&nbsp;</p>
<p><br />
</p>
</body>
</html>
